package com.roche.spring02.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 页面路由
 */
@Controller
public class routerController {

    @RequestMapping({"/","/index"})
    public String toIndex(){
        return "index";
    }

    @RequestMapping("/user/{pagename}")
    public String touser(@PathVariable(value="pagename") String pagename){
        return "/user/"+pagename;
    }


    @RequestMapping("/page/{pagename}")
    public String toPage(@PathVariable(value="pagename") String pagename){
        return "/page/"+pagename;
    }


    @RequestMapping("/info/{pagename}")
    public String toinfo(@PathVariable(value="pagename") String pagename){
        return "/info/"+pagename;
    }

}
